import { uniqueId } from 'lodash'

/**
 * @description 给菜单数据补充上 path 字段
 * @description https://github.com/d2-projects/d2-admin/issues/209
 * @param {Array} menu 原始的菜单数据
 */
function supplementPath (menu) {
  return menu.map(e => ({
    ...e,
    path: e.path || uniqueId('d2-menu-empty-'),
    ...e.children ? {
      children: supplementPath(e.children)
    } : {}
  }))
}

export const menuHeader = supplementPath([
  { path: '/index', title: '首页', icon: 'home' },
  // {
  //   title: 'FlexRAN',
  //   icon: 'folder-o',
  //   children: [
  //     { path: '/page1', title: 'API test' },
  //     { path: '/page2', title: 'RAN config' },
  //     { path: '/page3', title: '资源切片' },
  //     {path:'/networkSlicing', title: 'networkSlicing'},
  //   ]
  // },
  // {
  //   path: '/slicingLists',
  //   title: '网络切片',
  //   icon: 'home'
  // }, 
  // {
  //   path: '/serviceLists',
  //   title: '微服务集群管理',
  //   icon: 'home'
  // },
  // {
  //   path: '/topo',
  //   title: '网络拓扑',
  //   icon: 'home'
  // }
])
export const menuAside = supplementPath([
  { path: '/index', title: '首页', icon: 'home' },
  {
    title: 'FlexRAN',
    icon: 'folder-o',
    children: [
      // { path: '/page1', title: 'API test' },
      // { path: '/page2', title: 'RAN config' },
      // { path: '/page3', title: '资源切片' },
      // {path:'/networkSlicing', titile:'networkSlicing'},
    ]
  }
])
